package org.pb;

//import org.springframework.web.client.RestTemplate;

import org.springframework.web.client.RestTemplate;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Toast;

public class UserPanel extends Activity implements OnClickListener {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.userpanel);

		View orderTaxiButton = findViewById(R.id.Button03);
		orderTaxiButton.setOnClickListener(this);
		View myAccountButton = findViewById(R.id.Button04);
		myAccountButton.setOnClickListener(this);
		View logOutButton = findViewById(R.id.button2);
		logOutButton.setOnClickListener(this);


	}

	public void onClick(View arg0) {
		Intent i = null;
		switch (arg0.getId()) {


		case R.id.Button03:
		//	if (TaxiApplication.isUserIdSet()) {
				i = new Intent(this, MyTaxi.class);
				startActivity(i);
		//	}
		//	else{
			//	i = new Intent(this, Main.class);
			//	startActivity(i);
		//	}

			break;

		case R.id.Button04:
		//	if (TaxiApplication.isUserIdSet()) {
			i = new Intent(this, MyAccount.class);
			startActivity(i);
		//	}
		//	else{
		//		i = new Intent(this, Main.class);
		//		startActivity(i);
		//	}
			
			break;
			
		case R.id.button2:
            stopService(new Intent(UserPanel.this,NotificationService.class));

			break;

		}
	}
}